﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text.RegularExpressions;
using System.Text;
using System.Security.Cryptography;

/// <summary>
/// Summary description for class_string
/// </summary>
public class class_string
{
	public class_string()
	{		
	}

    public static bool IsNumberFloat(string pText)
    {
        Regex regex = new Regex(@"^[-+]?[0-9]*\.?[0-9]+$");
        return regex.IsMatch(pText);
    }

    public static string EncryptMD5(string data)
    {
        MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider();
        byte[] b = System.Text.Encoding.UTF8.GetBytes(data);
        b = MD5.ComputeHash(b);
        StringBuilder s = new StringBuilder();
        foreach (byte p in b)
        {
            s.Append(p.ToString("x").ToLower());
        }
        return s.ToString();
    }
}